ComponentOne Windows 7 Control Pack for WinForms
C1.Win.C1Win7Pack Namespace / C1TaskbarButton Class / RegisterFileAssociations Method / RegisterFileAssociations(Boolean,String,String,String,String[]) Method
Specifies whether the file associations should be registered in HKEY_CURRENT_USER, not in HKEY_CLASSES_ROOT which requires elevated privileges.
A friendly name for the data format, suitable to display to a user.
The path to the default icon, such as, "systemroot\system32\imageres.dll,15".
The command and arguments to be used when opening a shortcut to a document, such as, '"C:\Program Files\Paint.NET\PaintDotNet.exe" "%1"'.
The extensions to register, such as '.png'.

In This Topic
    RegisterFileAssociations(Boolean,String,String,String,String[]) Method
    In This Topic
    Registers file associations for the current application.
    Syntax
    'Declaration
     
    
    Public Overloads Sub RegisterFileAssociations( _
       ByVal forCurrentUser As Boolean, _
       ByVal friendlyName As String, _
       ByVal defaultIcon As String, _
       ByVal openWithCmd As String, _
       ByVal ParamArray extensions() As String _
    ) 
    public void RegisterFileAssociations( 
       bool forCurrentUser,
       string friendlyName,
       string defaultIcon,
       string openWithCmd,
       params string[] extensions
    )

    Parameters

    forCurrentUser
    Specifies whether the file associations should be registered in HKEY_CURRENT_USER, not in HKEY_CLASSES_ROOT which requires elevated privileges.
    friendlyName
    A friendly name for the data format, suitable to display to a user.
    defaultIcon
    The path to the default icon, such as, "systemroot\system32\imageres.dll,15".
    openWithCmd
    The command and arguments to be used when opening a shortcut to a document, such as, '"C:\Program Files\Paint.NET\PaintDotNet.exe" "%1"'.
    extensions
    The extensions to register, such as '.png'.
    See Also